package com.util;

public class Hex {

    public static String encode(Integer num , int count){
        String hex = Integer.toHexString(num) ;
        int c = count - hex.length() ;
        for(int i = 0 ; i < c ; i++) {
            hex = "0" + hex ;
        }
        return hex ;
    }

    public static void main(String[] args) {
        System.out.println(Hex.encode(1 , 8));
    }

}
